package com.example.smart_community.service;

import com.example.smart_community.mapper.NoticeMapper;
import com.example.smart_community.po.Notice;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoticeService {
    @Autowired
    private NoticeMapper noticeMapper;
    public List<Notice> selectAll(){
        return noticeMapper.selectAll();
    }
    public Notice selectById(Integer id){
        return noticeMapper.selectById(id);
    }
    public List<Notice> selectByTileAndTime( String title,  String time){
        return noticeMapper.selectByTileAndTime(title, time);
    }
    public int updateNotice( Integer id,String title, String content, String time,String person){
        return noticeMapper.updateNotice(id, title, content, time, person);
    }
    public int insertNotice(String title,String content,String time,String person){
        return noticeMapper.insertNotice(title, content, time, person);
    }
    public int deleteNotice(Integer id){
        return noticeMapper.deleteNotice(id);
    }
}
